package org.springblade.modules.policy.wrapper;

import org.springblade.core.mp.support.BaseEntityWrapper;
import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.core.tool.utils.SpringUtil;
import org.springblade.modules.policy.entity.LabelType;
import org.springblade.modules.policy.vo.LabelTypeVO;
import org.springblade.modules.system.service.IDictItemService;

public class LabelTypeWrapper extends BaseEntityWrapper<LabelType, LabelTypeVO> {

	private static IDictItemService dictItemService;

	static {
		dictItemService = SpringUtil.getBean(IDictItemService.class);
	}

	public static LabelTypeWrapper build() {
		return new LabelTypeWrapper();
	}

	@Override
	public LabelTypeVO entityVO(LabelType labelType) {
		LabelTypeVO labelTypeVO = BeanUtil.copy(labelType, LabelTypeVO.class);
		String systemName = dictItemService.getLabel("dict_type", labelType.getSystem());
		labelTypeVO.setSystemName(systemName);
		return labelTypeVO;
	}
}
